{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<PHP>
	function live_status($status){
        if($status==1){
            return "直播中";
        }elseif($status==2){
            return "正在创建直播";
        }elseif($status==3){
            return "历史";
        }else{
            return "直播结束";
        }

	}

	function get_level($id){
		$get_level=$GLOBALS['db']->getOne("select ul.name from ".DB_PREFIX."user_level as ul left join ".DB_PREFIX."user as u on u.user_level = ul.level where u.id=".$id);
 		return $get_level;
	}
	function get_nickname($id){
		$get_nickname=$GLOBALS['db']->getOne("select nick_name from ".DB_PREFIX."user where id=".$id);
 		return $get_nickname;
	}
    function get_room_type($room_type){
        if($room_type==1){
            return "私密";
        }elseif($room_type==2){
            return "聊天室";
        }elseif($room_type==3){
            return "互动聊天室";
        }else{
            return "公开";
        }
    }

    function check_video($id,$video){
        if($video['is_delete']==0){
            return "<a href=\"javascript:check_video('".$id."')\">检查视频</a>";
        }
    }
    function live_pay($is_live_pay){
    if($is_live_pay==0){
    return "否";
    }elseif($is_live_pay==1){
    return "是";
    }}

    function live_pay_type($live_pay_type,$video){
    if($video['is_live_pay']==1){
    if($live_pay_type==1){
    return "按场收费";
    }elseif($live_pay_type==0){
    return "按时收费";
    }elseif($live_pay_type==2){
    return "暂未收费";
    }
    }
    }
</PHP>
<script>
    function check_video(id){
        $.ajax({
            url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=check_video&id="+id,
            data: "ajax=1",
            dataType: "json",
            success: function(obj){
                alert(obj.info);
            }
        });
    }

function edit_index(id)
{
	location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=edit&id="+id;
}
    function del(id)
    {
        if(!id)
        {
            idBox = $(".key:checked");
            if(idBox.length == 0)
            {
                alert(LANG['DELETE_EMPTY_WARNING']);
                return;
            }
            idArray = new Array();
            $.each( idBox, function(i, n){
                idArray.push($(n).val());
            });
            id = idArray.join(",");
        }
        if(confirm(LANG['CONFIRM_DELETE']))
            $.ajax({
                url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=delete&id="+id,
                data: "ajax=1",
                dataType: "json",
                success: function(obj){
                    alert(obj.info);
                    func();
                    function func(){
                        if(obj.status==1){
                            location.href=location.href;
                        }
                    }
                }
            });
    }
</script>
<load href='__TMPL__Common/js/jquery.bgiframe.js' />
<load href='__TMPL__Common/js/jquery.weebox.js' />
<load href='__TMPL__Common/js/deal.js' />
<load href='__TMPL__Common/style/weebox.css' />
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />
<div class="main">
<div class="main_title_list"><div class="list-line-ico"></div>结束的直播</div>
<div class="button_row">
</div>
<div class="search_row">
	<form name="search" action="__APP__" method="get" class="clearfix">
        <div>房间号：<input type="text" class="textbox" name="room_id" value="{:trim($_REQUEST['room_id'])}" style="width:100px;" /></div>
        <div>主播ID: <input type="text" class="textbox" name="user_id" value="{:trim($_REQUEST['user_id'])}" style="width:100px;" /></div>
		<div>主播昵称：<input type="text" class="textbox" name="nick_name" value="{:trim($_REQUEST['nick_name'])}" style="width:100px;" /></div>
        <div>话题：<select name="cate_id">
				<option value="0">全部</option>
				<foreach name="cate_list" item="cate_item">
					<option value="{$cate_item.id}" <if condition="$_REQUEST['cate_id'] eq $cate_item['id']">selected="selected"</if>>{$cate_item.title}</option>
				</foreach>
			</select>
        </div>
        <div>创建时间：<span><input type="text" class="textbox" name="create_time_1" id="create_time_1" value="{$_REQUEST['create_time_1']}" onfocus="this.blur(); return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /><input type="button" class="button" id="btn_create_time_1" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /></span> - <span><input type="text" class="textbox" name="create_time_2" id="create_time_2" value="{$_REQUEST['create_time_2']}" onfocus="this.blur(); return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /><input type="button" class="button" id="btn_create_time_2" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /></span><input type="hidden" value="VideoEnd" name="m" /><input type="hidden" value="endline_index" name="a" /><input type="submit" class="button" value="{%SEARCH}" /></div>
	</form>
</div>
 <if condition="$is_pay_live eq 1">
 <html:list
         id="dataTable"
         style="dataTable"
         name="video"
         action="true"
         datasource="list"
         show="id:房间号
    ,user_id:用户ID
    ,user_id|get_nickname=$video['user_id']:主播
    ,title:直播标题
    ,max_watch_number:累计观看人数
    ,vote_number:{%TICKET}
    ,live_in|live_status=$video['live_id']:直播状态
    ,room_type|get_room_type=$video['room_type']:直播类型
    ,is_live_pay|live_pay:是否收费
    ,live_pay_type|live_pay_type=$video:收费类型
    ,create_time|to_date:创建时间
    ,end_time|to_date:结束时间
    ,len_time:直播时长"
         actionlist="contribution_list:{%TICKET_CONTRIBUTION},id|check_video=$video"/>
 <else/>
 <html:list
         id="dataTable"
         style="dataTable"
         name="video"
         action="true"
         datasource="list"
         show="id:房间号
    ,user_id:主播ID
    ,user_id|get_nickname=$video['user_id']:主播
    ,title:直播标题
    ,max_watch_number:累计观看人数
    ,vote_number:{%TICKET}
    ,live_in|live_status=$video['live_id']:直播状态
    ,room_type|get_room_type=$video['room_type']:直播类型
    ,create_time|to_date:创建时间
    ,end_time|to_date:结束时间
    ,len_time:直播时长"
         actionlist="contribution_list:{%TICKET_CONTRIBUTION},id|check_video=$video"/>
 </if>

	<!--<table class="dataTable">
		<tbody>
			<td colspan="12">
				<input type="button" class="button button-del" value="删除" onclick="del();" />
			</td>
		</tbody>
	</table>-->

<div class="page">{$page}</div>
</div>
<include file="Public:footer" />